pull: Only have API to disable signapi for local pulls
authorColin Walters <walters@verbum.org>
Sun, 17 May 2020 13:52:24 +0000 (13:52 +0000)
committerColin Walters <walters@verbum.org>
Sun, 17 May 2020 13:52:24 +0000 (13:52 +0000)
commit5a47c926c1762e3dd4397a71b13e8f8a475c5079
tree38cbbab957832f58bd94748bb308329269170bc7
parentb5e51d8c0843f97e720e9f17781706a7e4223169
pull: Only have API to disable signapi for local pulls

There's a lot of historical baggage associated with GPG verification
and `ostree pull` versus `ostree pull-local`.  In particular nowadays,
if you use a `file://` remote things are transparently optimized
to e.g. use reflinks if available.

So for anyone who doesn't trust the "remote" repository, you should
really go through through the regular
`ostree remote add --sign-verify=X file://`
path for example.

Having a mechanism to say "turn on signapi verification" *without*
providing keys goes back into the "global state" debate I brought
up in https://github.com/ostreedev/ostree/issues/2080

It's just much cleaner architecturally if there is exactly one
path to find keys: from a remote config.

So here in contrast to the GPG code, for `pull-local` we explictily
disable signapi validation, and the `ostree_repo_pull()` API just
surfaces flags to disable it, not enable it.
src/libostree/ostree-repo-pull.c
src/ostree/ot-builtin-pull-local.c
tests/test-local-pull.sh